use std::mem::drop;
struct Dog {
    name: String,
}
// 将dog实现Drop这个结构体
impl Drop for Dog {
    fn drop(&mut self) {
        println!("Dog {} leave", self.name);
    }
}
fn main() {
    let a = Dog{name: String::from("A")};
    let _b = Dog{name: String::from("B")};
    // rust实现了std::mem::drop()的方法，如下方法可以提前释放b
    drop(a);
    drop(_b);

    println!("=============================");
    println!("Hello, world!");
}
